import React from 'react'
import { TabBar } from 'antd-mobile'
import {
    AppOutline,
    MessageOutline,
    MessageFill,
    UnorderedListOutline,
    UserOutline,
  } from 'antd-mobile-icons'
import { useNavigate } from 'react-router-dom'
import styles from './css/MyTabBar.module.css'
function MyTabBar() {
    const nav=useNavigate()
    const tabs = [
        {
          key: '/home',
          title: '首页',
          icon: <AppOutline />,
         
        },
        {
          key: '/sq',
          title: '社区',
          icon: <UnorderedListOutline />,
        
        },
        {
          key: '/gl',
          title: '攻略',
          icon: (active) =>
            active ? <MessageFill /> : <MessageOutline />,
        
        },
        {
          key: '/my',
          title: '我的',
          icon: <UserOutline />,
        },
      ]
  return (
    <div className={styles.box}>
         <TabBar onChange={(key)=>nav(key)}>
          {tabs.map(item => (
            <TabBar.Item key={item.key} icon={item.icon} title={item.title} 
            />
          ))}
        </TabBar>
    </div>
  )
}

export default MyTabBar